const express = require('express');
const router = express.Router();

// 导入各个模块的路由
const packageRoutes = require('./packageRoutes');
const statRoutes = require('./statRoutes');
const tagRoutes = require('./tagRoutes');
const discussionRoutes = require('./discussionRoutes');
const syncRoutes = require('./syncRoutes');

// 使用各个模块的路由
router.use('/packages', packageRoutes);
router.use('/stats', statRoutes);
router.use('/tags', tagRoutes);
router.use('/discussions', discussionRoutes);
router.use('/sync', syncRoutes);

// 健康检查路由
router.get('/health', (req, res) => {
  res.json({
    status: 'ok',
    timestamp: new Date().toISOString()
  });
});

module.exports = router;